package common;

public class RoomTile {
	
	public Node nw;
	public Node ne;
	public Node sw;
	public Node se;
	
	private boolean entrance = false;
	private boolean exit = false;
	
	public int keyID = 0;
	
	public RoomTile(Node sw){
		this.sw = sw;
		this.nw = sw.north;
		this.se = sw.east;
		this.ne = sw.east.north; // /!\npe
	}
	
	public boolean containsNode(Node n){
		return nw.equals(n) || sw.equals(n) || ne.equals(n) || se.equals(n);
	}
	
	public boolean containsWall(Wall wall){
		return containsNode(wall.n1) && containsNode(wall.n2);
	}
	
	public boolean equals(RoomTile t){
		return this.sw.equals(t.sw);
	}
	
	public String toString(){
		return "Tile : (sw = " + sw + ")";
	}
	
	public void setEntrance(boolean b){
		entrance = b;
	}
	
	public void setExit(boolean b){
		exit = b;
	}
	
	public boolean isEntrance(){
		return entrance;
	}
	
	public boolean isExit(){
		return exit;
	}

}
